from django.db import models


class Linedayflow(models.Model):
    lineid = models.IntegerField(db_column='lineID', primary_key=True)  # Field name made lowercase.
    date = models.DateField()
    timetype = models.IntegerField(db_column='timeType')  # Field name made lowercase.
    day = models.IntegerField()
    flow = models.IntegerField()

    class Meta:
        managed = False
        db_table = 'linedayflow'
        unique_together = (('lineid', 'date', 'timetype'),)


class Lineflow(models.Model):
    lineid = models.IntegerField(db_column='lineID', primary_key=True)  # Field name made lowercase.
    day = models.IntegerField()
    timetype = models.IntegerField(db_column='timeType')  # Field name made lowercase.
    passengerflow = models.IntegerField(db_column='passengerFlow', blank=True, null=True)  # Field name made lowercase.

    class Meta:
        managed = False
        db_table = 'lineflow'
        unique_together = (('lineid', 'day', 'timetype'),)


class Month6(models.Model):
    id = models.BigAutoField(primary_key=True)
    cardid = models.CharField(db_column='cardId', max_length=255, blank=True, null=True)  # Field name made lowercase.
    indate = models.DateField(db_column='inDate', blank=True, null=True)  # Field name made lowercase.
    intime = models.TimeField(db_column='inTime', blank=True, null=True)  # Field name made lowercase.
    instopid = models.IntegerField(db_column='inStopId', blank=True, null=True)  # Field name made lowercase.
    outdate = models.DateField(db_column='outDate', blank=True, null=True)  # Field name made lowercase.
    outtime = models.TimeField(db_column='outTime', blank=True, null=True)  # Field name made lowercase.
    outstopid = models.IntegerField(db_column='outStopId', blank=True, null=True)  # Field name made lowercase.
    fee = models.FloatField(blank=True, null=True)
    type = models.CharField(max_length=255, blank=True, null=True)
    weekday = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'month6'


class Station(models.Model):
    stationid = models.IntegerField(db_column='stationID', primary_key=True)  # Field name made lowercase.
    stationname = models.CharField(db_column='stationName', max_length=255)  # Field name made lowercase.
    lineid = models.ForeignKey(Lineflow, models.DO_NOTHING, db_column='lineID')  # Field name made lowercase.
    prestationid = models.IntegerField(db_column='preStationID', blank=True, null=True)  # Field name made lowercase.
    nextstationid = models.IntegerField(db_column='nextStationID', blank=True, null=True)  # Field name made lowercase.
    transfer = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'station'


class Stationdayflow(models.Model):
    stationid = models.IntegerField(db_column='stationID', primary_key=True)  # Field name made lowercase.
    date = models.DateField(db_column='Date')  # Field name made lowercase.
    day = models.IntegerField()
    timetype = models.IntegerField(db_column='timeType')  # Field name made lowercase.
    flow = models.IntegerField()

    class Meta:
        managed = False
        db_table = 'stationdayflow'
        unique_together = (('stationid', 'date', 'timetype'),)


class Stationflow(models.Model):
    stationid = models.IntegerField(db_column='stationID', primary_key=True)  # Field name made lowercase.
    day = models.IntegerField()
    timetype = models.IntegerField(db_column='timeType')  # Field name made lowercase.
    passengerflow = models.IntegerField(db_column='passengerFlow', blank=True, null=True)  # Field name made lowercase.

    class Meta:
        managed = False
        db_table = 'stationflow'
        unique_together = (('stationid', 'day', 'timetype'),)